package com.ycrlkj.android.modulescore.main.apiservice;

import com.ycrlkj.android.modulescore.main.entity.Query.VehicleQuery;
import com.ycrlkj.android.modulespublic.common.net.response.MResponse;
import com.ycrlkj.android.modulescore.main.entity.Vehicle;
import com.ycrlkj.android.modulespublic.common.net.response.ResultData;

import java.util.List;
import io.reactivex.Observable;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Path;


/**
 * 复制此类时说明:
 * 注意: 每新增一个 XXXXApiService 文件需要向 BaseApiService 中添加一个注入的生产者
 */
public interface VehicleApiService {

    @GET("vehicle/getAllByUserId/{userId}")
    Observable<MResponse<List<Vehicle>>> getAllByUserId(@Path("userId") String userId);

    @POST("vehicle/getAll")
    Observable<MResponse<List<Vehicle>>> getAll(@Body VehicleQuery vehicleQuery);

    @GET("vehicle/getById/{id}")
    Observable<MResponse<Vehicle>> getById(@Path("id") String id);

    @POST("vehicle/register")
    Observable<MResponse<ResultData>> register(@Body Vehicle vehicle);

    @PUT("vehicle/edit")
    Observable<MResponse<ResultData>> edit(@Body Vehicle vehicle);

}
